/* Estructura principal del grid */
main {
    display: grid;
    grid-template-columns: 250px 1fr 0px;
    grid-template-rows: auto auto auto auto auto auto; /* 6 filas específicas */
    gap: 5px; /* Reducido de 10px a 5px */
    max-width: 1200px;
    margin: auto;
}

/* Contenedor principal con display grid */
#main {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
}

/* Grid izquierdo */
.left-grid {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Grid derecho */
.right-grid {
    grid-column: 2;
    display: grid;
    grid-template-rows: auto auto 1fr auto; /* Añadido auto para paginación */
    gap: 5px;
}

/* Breadcrumb siempre en la primera fila */
.breadcrumb-bar {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
    background-color: #555c5c;
    padding: 10px 20px;
    border-radius: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: left;
    margin-bottom: 20px;
    height: 50px; /* Asegura que la altura sea consistente */
}
/* Ajustes para el breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px; /* Espacio entre los elementos */
}

.breadcrumb a {
    text-decoration: none;
    color: #ffffff;
    font-weight: bold;
}

.breadcrumb span {
    color: #ffffff;
}


/* Sidebar principal en la segunda fila */
.sidebar {
    background-color: #ffffff;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
    grid-column: 1;
    grid-row: 2;
    transition: opacity 0.4s ease, transform 0.4s ease;
    
}

.sidebar h3 {
    margin-top: 0;
    font-size: 18px;
    font-weight: bold;
    color: #696b6b;
}

#toggle-categories {
    font-weight: bold;
    width: 100%;
    padding: 8px;
    background: #ffffff;
    color: rgb(104, 100, 100);
    border: none;
    cursor: pointer;
    font-size: 16px;
    text-align: left;
}

#toggle-categories span {
    margin-right: 8px;
}



.transition-effect {
    transition: margin-top 0.4s ease;
} 


.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    padding: 6px 0;
}

.sidebar a {
    text-decoration: none;
    color: #8f9091;
    font-size: 14px;
    font-weight: normal;
    transition: color 0.3s;
}

.sidebar a:hover {
    color: #000000;
}




/* Sidebar-right en la segunda fila */
.sidebar-right {
    background-color: #ffffff;
    padding: 10px; /* Reducir el padding para hacer más pequeño el contenido */
    border-radius: 15px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
    height: 40px; /* Reducir la altura para que coincida mejor con el tamaño de los elementos */
    display: flex; /* Alineación horizontal */
    align-items: center; /* Centrar los elementos verticalmente */
    gap: 15px; /* Espacio entre los elementos dentro de la barra */
    flex-wrap: wrap; /* Permite que los elementos se ajusten si hay espacio limitado */
    grid-column: 2;
    grid-row: 1;
    position: relative;
    z-index: 2;
    margin-bottom: 5px; /* Agregar un margen mínimo */
    margin: 0;
}

/* El primer elemento a la izquierda (productos-info) */
.productos-info {
    flex: 1; /* Este ocupa el espacio disponible */
    font-size: 14px; /* Reducir el tamaño de fuente */
    color: #333;
    margin: 0; /* Eliminar márgenes innecesarios */
}



/* El segundo elemento a la derecha (productos-por-pagina y ordenar-por) */
.productos-por-pagina,
.ordenar-por {
    margin-left: auto; /* Empuja los elementos a la derecha */
    font-size: 14px; /* Reducir el tamaño de fuente */
    margin-right: 20px;
}

/* Estilos de productos y opciones en la barra derecha */
.productos-info, .productos-por-pagina {
    font-size: 14px; /* Reducir el tamaño de fuente */
    color: #333;
    margin-bottom: 8px; /* Reducir el espacio inferior */
    margin-top: -5px;
}

/* Menú desplegable "Ordenar por" */
.ordenar-por {
    display: flex; /* Hace que las opciones se alineen horizontalmente */
    align-items: center; /* Centra las opciones verticalmente */
    gap: 1px; /* Reducir el espacio entre el label y el select */
    margin-bottom: 8px;
    margin-top: -5px;
}

/* Estilo de la etiqueta "Ordenar por" */
.ordenar-por label {
    font-weight: normal;
    margin-bottom: 0; /* Eliminar margen inferior */
    font-size: 14px; /* Reducir el tamaño de la etiqueta */
}

/* Estilo del select dentro de "Ordenar por" */
.ordenar-por select {
    width: 110px; /* Ajustar el tamaño del select */
    padding: 6px 10px; /* Reducir el padding */
    border: none; /* Eliminar borde */
    border-radius: 20px; /* Aplicar border-radius */
    background-color: #ffffff; /* Fondo gris suave */
    font-size: 14px; /* Reducir tamaño de fuente */
    cursor: pointer;
    appearance: none; /* Eliminar estilo predeterminado en navegadores */
    font-weight: bold;
}

/* Ajustar posición de barra-publicidad */
.barra-publicidad {
    grid-column: 2;
    grid-row: 2; /* Tercera fila */
    background-color: #ac965c;
    padding: 10px;
    border-radius: 35px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 0; /* Eliminar márgenes */
    position: relative;
    z-index: 1; /* Reducido el z-index */
    margin-top: 5px; /* Agregar un margen mínimo arriba */
    margin: 0;
    margin-bottom: 0;
}

/* Estilos de texto dentro de la barra de publicidad */
.barra-publicidad p {
    font-size: 40px;
    font-weight: bold;
    color: #ffffff;
    margin: 0;
    transition: font-size 0.3s ease;
}

/* Media queries para el texto de publicidad */
@media screen and (max-width: 992px) {
    .barra-publicidad p {
        font-size: 32px;
    }
}

@media screen and (max-width: 768px) {
    .barra-publicidad p {
        font-size: 24px;
    }
}

@media screen and (max-width: 576px) {
    .barra-publicidad p {
        font-size: 18px;
    }
}


/* Filtro de marcas en la cuarta fila */
.sidebar-filter {
    background-color: #ffffff;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
    grid-column: 1;
    grid-row: 4;
    max-height: fit-content;
    margin-bottom: 20px; /* Añadir espacio entre los filtros */
}

.sidebar-filter h3 {
    margin-top: 0;
    font-size: 18px;
    font-weight: bold;
    color: #696b6b;
}

.sidebar-filter ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-filter li {
    padding: 6px 0;
}

.sidebar-filter input[type="checkbox"] {
    margin-right: 10px; /* Espacio entre el checkbox y el texto */
}

.sidebar-filter label {
    font-size: 14px;
    color: #8f9091;
    font-weight: normal;
    transition: color 0.3s;
}

.sidebar-filter label:hover {
    color: #000000;
}


/* Rango de precios en la quinta fila */
.sidebar-price {
    position: relative; /* Cambiar de fixed a relative */
    width: 250px;
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 0; /* Eliminar margin-top */
    grid-column: 1;
    grid-row: 5;
    max-height: fit-content;
}

.sidebar-price h3 {
    margin-top: 0;
    font-size: 18px;
    font-weight: bold;
    color: #696b6b;
}

.sidebar-price input[type="range"] {
    width: 100%; /* Hace que la barra ocupe todo el ancho del contenedor */
    -webkit-appearance: none; /* Elimina el estilo por defecto en Webkit */
    appearance: none;
    height: 8px; /* Ajusta la altura de la barra */
    background: #ddd; /* Fondo gris claro */
    border-radius: 5px; /* Bordes redondeados */
    outline: none; /* Elimina el contorno cuando se selecciona */
}

.sidebar-price input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; /* Elimina el estilo por defecto del pulgar */
    appearance: none;
    width: 20px; /* Tamaño del pulgar */
    height: 20px;
    background: #000000; /* Color del pulgar */
    border-radius: 50%; /* Hacerlo redondo */
    cursor: pointer;
}

.sidebar-price input[type="range"]:focus {
    background: #b8c7c7; /* Fondo cuando se enfoca */
}

.sidebar-price .precio-rango {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 14px;
    color: #8f9091;
}

.sidebar-price .precio-rango span {
    font-weight: normal;
}

.precio-rango {
    margin-top: 10px;
    text-align: center;
}

#precio-range {
    width: 100%;
    margin: 10px 0;
}

/* Ajustar el contenedor de productos */
#product-container {
    grid-column: 2;
    grid-row: 3;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px; /* Reducido de 20px a 15px */
    position: relative;
    z-index: 2; /* Aumentado el z-index */
    margin: 5px 0; /* Margen muy leve arriba y abajo */
    margin: 0;
    align-content: start; /* Asegura que los productos se alineen al inicio */
}

/* Eliminar márgenes específicos de los primeros y últimos productos */
#product-container .product-slide:nth-child(-n+4) {
    margin-top: 0; /* Eliminado el margin negativo */
}

#product-container .product-slide:nth-last-child(-n+4) {
    margin-bottom: 0; /* Eliminado el margen inferior */
}

/* Estilo específico para cuando hay 4 o menos productos */
#product-container:has(.product-slide:nth-child(-n+4):last-child) {
    margin-top: 120px; /* Añadir margen arriba */
    grid-row: 3;
}

/* Ajustar el contenedor de productos - Versión desktop */
#product-container {
    grid-template-columns: repeat(4, 1fr); /* 4 productos por defecto */
}

.product-slide {
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    transition: transform 0.3s ease-in-out;
    height: 450px; /* Altura fija para la tarjeta */
    position: relative; /* Para posicionamiento del contenido */
}

.product-slide:hover {
    transform: scale(1.05); /* Efecto de hover */
}

.product-slide img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    margin-bottom: 15px;
}

.product-description {
    text-align: center;
    color: #333;
    display: flex;
    flex-direction: column;
    height: 200px; /* Altura fija para la descripción */
    position: relative;
}

.product-description h3 {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.product-description p {
    font-size: 14px;
    color: #777;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limita a 3 líneas */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-size: 16px;
    font-weight: bold;
    color: #2e8b57;
    margin-bottom: 8px; /* Reducido el margen inferior */
    position: absolute;
    bottom: 60px; /* Ajustado para estar justo encima del botón */
    left: 0;
    right: 0;
}

.add-to-cart-container {
    position: absolute;
    bottom: 20px; /* Distancia desde el fondo */
    left: 0;
    right: 0;
    margin: auto;
}

/* Estilos base para el botón agregar */
.btn-add-to-cart {
    width: 60%;
    background-color: #ffffff;
    color: rgb(112, 109, 109);
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 25px;
    font-weight: bold;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

.btn-add-to-cart:hover {
    background-color: transparent;  /* Elimina el color de fondo en el hover */
    transform: scale(1.1);  /* Aumenta el tamaño del botón un 10% */
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.3);  /* Aumenta la sombra en el hover */
}

/* Media Queries Consolidados */
@media screen and (max-width: 1200px) {
    .btn-add-to-cart {
        width: 70%;
        padding: 8px 15px;
        font-size: 13px;
    }
}

@media screen and (max-width: 992px) {
    /* Product Container */
    #product-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    /* Product Cards */
    .product-slide {
        height: 400px;
        padding: 15px;
    }

    .product-slide img {
        max-height: 180px;
        margin-bottom: 12px;
    }

    .product-description {
        height: 180px;
    }

    .product-description h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .product-description p {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .product-price {
        font-size: 15px;
        bottom: 55px;
    }

    /* Button */
    .btn-add-to-cart {
        width: 80%;
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Left Grid */
    .left-grid {
        width: 200px;
    }

    .sidebar h3,
    .sidebar-filter h3,
    .sidebar-price h3 {
        font-size: 14px;
    }

    .sidebar a,
    .sidebar-filter label {
        font-size: 13px;
    }
}

@media screen and (max-width: 768px) {
    /* Layout */
    .left-grid {
        display: none;
    }

    #main {
        grid-template-columns: 1fr;
    }

    .right-grid {
        grid-column: 1;
    }

    /* Product Container */
    #product-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Product Cards */
    .product-slide {
        height: 360px;
        padding: 10px;
        max-width: 280px;
        margin: 0 auto;
        width: 100%;
    }

    .product-slide img {
        max-height: 160px;
        margin-bottom: 10px;
        width: auto;
        max-width: 100%;
    }

    .product-description {
        height: 160px;
    }

    .product-description h3 {
        font-size: 15px;
        margin-bottom: 6px;
    }

    .product-description p {
        font-size: 12px;
        margin-bottom: 6px;
        -webkit-line-clamp: 2;
    }

    .product-price {
        font-size: 14px;
        bottom: 40px;
    }

    .add-to-cart-container {
        bottom: 8px;
    }

    /* Button */
    .btn-add-to-cart {
        width: 90%;
        padding: 6px 10px;
        font-size: 11px;
    }
}

@media screen and (max-width: 576px) {
    /* Product Container */
    #product-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    /* Product Cards */
    .product-slide {
        height: 280px !important;
        padding: 8px 8px 0 8px;
        max-width: 240px;
    }

    .product-slide img {
        max-height: 130px;
        margin-bottom: 5px;
    }

    .product-description {
        height: 100px !important;
        padding: 0 5px;
    }

    .product-description h3 {
        font-size: 14px;
        margin-bottom: 3px;
    }

    .product-description p {
        font-size: 11px;
        margin-bottom: 3px;
        -webkit-line-clamp: 2;
    }

    .product-price {
        font-size: 13px;
        bottom: 25px !important;
        margin: 0;
    }

    .add-to-cart-container {
        bottom: 0 !important;
        padding-bottom: 5px;
    }

    /* Button */
    .btn-add-to-cart {
        width: 100%;
        padding: 5px 8px;
        font-size: 10px;
    }
}

/* Media queries para diferentes tamaños de pantalla */
@media screen and (max-width: 992px) {
    #product-container {
        grid-template-columns: repeat(3, 1fr); /* 3 productos por fila */
        gap: 12px; /* Reducir el espacio entre productos */
    }

    .product-slide {
        height: 400px; /* Reducir un poco la altura */
    }
}

@media screen and (max-width: 768px) {
    #product-container {
        grid-template-columns: repeat(2, 1fr); /* 2 productos por fila */
        gap: 10px;
        justify-content: center;
    }

    .product-slide {
        height: 360px; /* Reduced from 380px */
        padding: 10px;
        max-width: 280px; /* Added max-width */
        margin: 0 auto; /* Center the cards */
        width: 100%; /* Ensure it's responsive */
    }

    .product-slide img {
        max-height: 160px;
        margin-bottom: 10px;
        width: auto; /* Allow image to maintain aspect ratio */
        max-width: 100%; /* Prevent image overflow */
    }

    .product-price {
        bottom: 40px; /* Adjusted to be closer to button */
    }

    .add-to-cart-container {
        bottom: 8px; /* Reduced from 15px */
    }
}

@media screen and (max-width: 576px) {
    #product-container {
        grid-template-columns: repeat(2, 1fr); /* Mantener 2 productos */
        gap: 8px;
    }

    .product-slide {
        height: 320px; /* Reduced height */
        padding: 8px 8px 2px 8px; /* Reduced bottom padding */
        max-width: 240px; /* Smaller max-width for mobile */
    }

    .product-slide img {
        max-height: 140px;
        margin-bottom: 8px;
    }

    .product-description {
        height: 130px; /* Reduced height */
        padding: 0 5px; /* Added padding for text containment */
    }

    .product-description h3 {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .product-description p {
        font-size: 11px;
        margin-bottom: 5px;
    }

    .product-price {
        font-size: 13px;
        bottom: 30px; /* Closer to button */
        margin-bottom: 0;
    }

    .add-to-cart-container {
        bottom: 2px; /* Minimal spacing from bottom */
    }

    .btn-add-to-cart {
        padding: 5px 8px; /* Slightly reduced padding */
    }
}

@media screen and (max-width: 576px) {
    .product-slide {
        height: 300px; /* Reduced from 320px */
        padding: 8px 8px 0 8px; /* Removed bottom padding */
    }

    .product-description {
        height: 120px; /* Reduced from 130px */
        padding: 0 5px;
    }

    .product-slide img {
        max-height: 130px; /* Reduced from 140px */
        margin-bottom: 5px; /* Reduced from 8px */
    }

    .product-description h3 {
        font-size: 14px;
        margin-bottom: 3px; /* Reduced from 5px */
    }

    .product-description p {
        font-size: 11px;
        margin-bottom: 3px; /* Reduced from 5px */
        -webkit-line-clamp: 2;
    }

    .product-price {
        font-size: 13px;
        bottom: 25px; /* Reduced from 30px */
        margin: 0;
    }

    .add-to-cart-container {
        bottom: 0; /* Changed from 2px to 0 */
        padding-bottom: 5px; /* Added padding instead of margin */
        top:80px
    }
}

/* Media queries para diferentes tamaños de pantalla */
@media screen and (max-width: 992px) {
    #product-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .product-slide {
        height: 400px;
        padding: 15px;
    }

    .product-slide img {
        max-height: 180px;
        margin-bottom: 12px;
    }

    .product-description {
        height: 180px;
    }

    .product-description h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .product-description p {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .product-price {
        font-size: 15px;
        bottom: 55px;
    }
}

@media screen and (max-width: 768px) {
    #product-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-slide {
        height: 360px; /* Reduced from 380px */
        padding: 10px;
    }

    .product-slide img {
        max-height: 160px;
        margin-bottom: 10px;
    }

    .product-description {
        height: 160px;
    }

    .product-description h3 {
        font-size: 15px;
        margin-bottom: 6px;
    }

    .product-description p {
        font-size: 12px;
        margin-bottom: 6px;
        -webkit-line-clamp: 2;
    }

    .product-price {
        font-size: 14px;
        bottom: 60px; /* Adjusted to be closer to button */
    }

    .add-to-cart-container {
        bottom: 8px; /* Reduced from 15px */
    }
}

@media screen and (max-width: 576px) {
    #product-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .product-slide {
        height: 340px; /* Reduced from 350px */
        padding: 8px;
    }

    .product-slide img {
        max-height: 140px;
        margin-bottom: 8px;
    }

    .product-description {
        height: 140px;
    }

    .product-description h3 {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .product-description p {
        font-size: 11px;
        margin-bottom: 5px;
    }

    .product-price {
        font-size: 13px;
        bottom: 35px; /* Closer to button */
    }

    .add-to-cart-container {
        bottom: 5px; /* Minimal spacing */
    }
}

/* Left grid base styles */
.left-grid {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Media queries for different screen sizes */
@media screen and (max-width: 992px) {
    .left-grid {
        width: 200px; /* Reduced from 250px */
    }

    .sidebar h3,
    .sidebar-filter h3,
    .sidebar-price h3 {
        font-size: 14px;
    }

    .sidebar a,
    .sidebar-filter label {
        font-size: 13px;
    }

    .sidebar li,
    .sidebar-filter li {
        padding: 4px 0;
    }
}

@media screen and (max-width: 768px) {
    .left-grid {
        display: none; /* Hide on mobile screens */
    }

    /* Adjust main grid when left-grid is hidden */
    #main {
        grid-template-columns: 1fr;
    }

    .right-grid {
        grid-column: 1;
    }
}

/* Media queries for responsive design */
@media screen and (max-width: 992px) {
    .sidebar-right {
        padding: 8px;
    }

    .productos-info, 
    .productos-por-pagina {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .ordenar-por label {
        font-size: 12px;
    }

    .ordenar-por select {
        width: 100px;
        padding: 4px 8px;
        font-size: 12px;
    }

    .barra-publicidad {
        height: 70px;
        padding: 8px;
        font-size: 14px;
    }
}

@media screen and (max-width: 768px) {
    .sidebar-right {
        padding: 6px;
    }

    .productos-info, 
    .productos-por-pagina {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .ordenar-por {
        gap: 5px;
    }

    .ordenar-por label {
        font-size: 11px;
    }

    .ordenar-por select {
        width: 90px;
        padding: 3px 6px;
        font-size: 11px;
    }

    .barra-publicidad {
        height: 60px;
        padding: 6px;
        font-size: 12px;
        border-radius: 25px;
    }
}

@media screen and (max-width: 576px) {
    .sidebar-right {
        padding: 5px;
    }

    .productos-info, 
    .productos-por-pagina {
        font-size: 10px;
        margin-bottom: 3px;
    }

    .ordenar-por {
        gap: 3px;
    }

    .ordenar-por label {
        font-size: 10px;
    }

    .ordenar-por select {
        width: 80px;
        padding: 2px 4px;
        font-size: 10px;
    }

    .barra-publicidad {
        height: 50px;
        padding: 5px;
        font-size: 11px;
        border-radius: 20px;
    }
}

/* Media queries for responsive design */
@media screen and (max-width: 768px) {
    /* Hide specific elements */
    .productos-info, 
    .productos-por-pagina {
        display: none;
    }

    /* Center sorting dropdown */
    .sidebar-right {
        display: flex;
        justify-content: center;
        padding: 5px;
    }

    .ordenar-por {
        display: flex;
        justify-content: center;
        align-items: center;
        width: auto;
        gap: 5px;
    }

    .ordenar-por select {
        width: 120px;
        font-size: 12px;
    }
}

@media screen and (max-width: 576px) {
    .ordenar-por select {
        width: 100px;
        font-size: 11px;
    }

    .ordenar-por label {
        font-size: 11px;
    }
}

/* Media queries for responsive design */
@media screen and (max-width: 991px) {
    /* Hide specific elements */
    .productos-info, 
    .productos-por-pagina {
        display: none;
    }

    /* Center sorting dropdown */
    .sidebar-right {
        display: flex;
        justify-content: center;
        padding: 5px;
        height: 35px;
    }

    .ordenar-por {
        display: flex;
        justify-content: center;
        align-items: center;
        width: auto;
        gap: 5px;
        margin: 0;
    }

    .ordenar-por select {
        width: 120px;
        font-size: 12px;
    }

    .ordenar-por label {
        font-size: 12px;
    }
}

@media screen and (max-width: 768px) {
    .ordenar-por select {
        width: 110px;
        font-size: 11px;
    }
}

@media screen and (max-width: 576px) {
    .ordenar-por select {
        width: 100px;
        font-size: 10px;
    }

    .ordenar-por label {
        font-size: 10px;
    }
}

/* Pagination container styles */
.pagination-container {
    grid-column: 2;
    grid-row: 4;
    background-color: #ffffff;
    padding: 5px;
    border-radius: 15px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 20px 0;
}

.pagination {
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 100%;
}

.pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555c5c;
    border: none;
    padding: 0;
    margin: 0;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-size: 14px;
    height: 30px;
    width: 30px;
    line-height: 1;
}

/* Ajustes para las flechas */
.pagination .page-link[aria-label="Previous"],
.pagination .page-link[aria-label="Next"] {
    width: 30px;
    height: 30px;
}

/* Media queries */
@media screen and (max-width: 768px) {
    .pagination-container {
        height: 35px;
    }

    .pagination .page-link {
        height: 25px;
        width: 25px;
        font-size: 12px;
    }
}

@media screen and (max-width: 576px) {
    .pagination-container {
        height: 30px;
    }

    .pagination .page-link {
        height: 22px;
        width: 22px;
        font-size: 11px;
    }
}

.pagination-container {
    grid-row: 4; /* Posiciona la paginación en la última fila */
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

.pagination .page-link {
    color: #555c5c;
    border: none;
    padding: 8px 16px;
    margin: 0 4px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.pagination .page-item.active .page-link {
    background-color: #555c5c;
    color: white;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    color: #555c5c;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: transparent;
}

@media screen and (max-width: 576px) {
    .pagination .page-link {
        padding: 6px 12px;
        font-size: 14px;
    }
}

/* Media query para ajustar en pantallas pequeñas */
@media screen and (max-width: 768px) {
    .right-grid {
        grid-column: 1; /* Ajuste cuando el left-grid está oculto */
    }
}

/* Pagination styles */
.pagination .page-link {
    color: #555c5c;
    border: none;
    padding: 8px 16px;
    margin: 0 4px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

/* Estilos específicos para las flechas */
.pagination .page-link[aria-label="Previous"],
.pagination .page-link[aria-label="Next"] {
    background-color: transparent;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Estilos para los símbolos de las flechas */
.pagination .page-link span[aria-hidden="true"] {
    color: #555c5c;
}

/* Estados hover para las flechas */
.pagination .page-link[aria-label="Previous"]:hover,
.pagination .page-link[aria-label="Next"]:hover {
    background-color: #e9ecef;
}

/* Estado disabled para las flechas */
.pagination .page-item.disabled .page-link[aria-label="Previous"],
.pagination .page-item.disabled .page-link[aria-label="Next"] {
    color: #6c757d;
    pointer-events: none;
    background-color: transparent;
}

/* Media queries */
@media screen and (max-width: 576px) {
    .pagination .page-link[aria-label="Previous"],
    .pagination .page-link[aria-label="Next"] {
        padding: 6px 12px;
    }
}

/* Base styles for pagination buttons */
.pagination .page-link {
    color: #555c5c;
    border: none;
    padding: 8px 16px;
    margin: 0 4px;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-size: 14px;
}

/* Media queries for responsive pagination */
@media screen and (max-width: 992px) {
    .pagination .page-link {
        padding: 7px 14px;
        font-size: 13px;
        margin: 0 3px;
    }
}

@media screen and (max-width: 768px) {
    .pagination .page-link {
        padding: 6px 12px;
        font-size: 12px;
        margin: 0 2px;
    }

    .pagination-container {
        height: 35px;
    }
}

@media screen and (max-width: 576px) {
    .pagination .page-link {
        padding: 4px 8px;
        font-size: 11px;
        margin: 0 1px;
    }

    .pagination-container {
        height: 30px;
    }
}
